package com.kingbi.util;

/** 
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates. To enable and disable the creation of type
 * comments go to Window>Preferences>Java>Code Generation.
 */
import java.io.InputStream;
import java.util.Properties;

public class ParasProperty
{
    private static ParasProperty instance;

    public static String attachPath;

    public static String targetStartX;

    public static String targetStartY;

    public static String targetRows;

    public static String attachDirectory;

    public static String monitorStartX;

    public static String monitorStartY;

    public static String monitorCols;

    public static String sumStartX;

    public static String sumStartY;

    public static String sumCols;

    public static String excelPwd;

    public static String excelLogoPath;

    public static String reportPath;
    
    public static String initialPassword;
    
    public static String showPercent; //--配置同比值
    
    public static String IndexStartX; //--行业价格指标导入excel开始x坐标（行）

    public static String IndexStartY; //--行业价格指标导入excel开始y坐标（列）
    
    public static String IndexCols;  //--行业价格指标导入excel有效列数
    
    public static String IndexRows;  //--行业价格指标导入excel有效行数
    
    public static String domainName;  //--域名
    
    public static String domainCount;  //--域个数
    
    public static String checkType;  //--审核类型
    
    public static String checkStatus;  //--审核状态

    public ParasProperty(String fileProperty) throws Exception
    {

        String propertiesFile = "/sysPath.properties";
        try
        {
            Properties p = new Properties();
            InputStream in = getClass().getResourceAsStream(propertiesFile);
            p.load(in);
            attachPath = p.getProperty(fileProperty);
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw e;
        }
    }

    /**
     * @preserve
     */
    private ParasProperty() throws Exception
    {

        String propertiesFile = "/sysPath.properties";

        try
        {
            Properties p = new Properties();
            InputStream in = getClass().getResourceAsStream(propertiesFile);
            p.load(in);
            attachPath = p.getProperty("attachPath").trim();
            targetStartX = p.getProperty("targetStartX").trim();
            targetStartY = p.getProperty("targetStartY").trim();
            targetRows = p.getProperty("targetRows").trim();
            attachDirectory = p.getProperty("attachDirectory").trim();
            monitorStartX = p.getProperty("monitorStartX").trim();
            monitorStartY = p.getProperty("monitorStartY").trim();
            monitorCols = p.getProperty("monitorCols").trim();
            sumStartX = p.getProperty("sumStartX").trim();
            sumStartY = p.getProperty("sumStartY").trim();
            sumCols = p.getProperty("sumCols").trim();
            excelPwd = p.getProperty("excelPwd");
            excelLogoPath = p.getProperty("excelLogoPath");
            reportPath = p.getProperty("reportPath");
            initialPassword = p.getProperty("initialPassword");
            showPercent = p.getProperty("showPercent"); //--获取配置同比比较值
            IndexStartX = p.getProperty("IndexStartX").trim();
            IndexStartY = p.getProperty("IndexStartY").trim();
            IndexCols = p.getProperty("IndexCols").trim();
            IndexRows = p.getProperty("IndexRows").trim();
            domainName = p.getProperty("domainName").trim();
            domainCount = p.getProperty("domainCount").trim();
            checkType = p.getProperty("checkType").trim();
            checkStatus = p.getProperty("checkStatus").trim();
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw e;
        }
    }

    synchronized public static ParasProperty getInstance() throws Exception
    {

        if(instance == null)
        {
            instance = new ParasProperty();
        }
        return instance;
    }

}